package com.ziyueyuwen.xiniao.dao;

import com.ziyueyuwen.xiniao.bean.homework.IdInfoData;
import com.ziyueyuwen.xiniao.bean.homework.ZySubjectQuestionDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import static com.ziyueyuwen.xiniao.util.ConstUtil.KEY_HOMEWORK_INDEX;
import static com.ziyueyuwen.xiniao.util.ConstUtil.KEY_SUBJECT_ID;

/**
 * @author jun 2018/12/20
 */
public interface ZySubjectQuestionMapper {

    /**
     * 添加数据
     *
     * @param zySubjectQuestionDO ZySubjectQuestionDO
     * @return Boolean
     */
    Boolean add(ZySubjectQuestionDO zySubjectQuestionDO);

    /**
     * 编辑数据
     *
     * @param zySubjectQuestionDO ZySubjectQuestionDO
     * @return Boolean
     */
    Boolean update(ZySubjectQuestionDO zySubjectQuestionDO);

    /**
     * 根据套题id, 获取题目数据
     *
     * @param subjectId Integer
     * @return List<ZySubjectQuestionDO>
     */
    List<ZySubjectQuestionDO> listBySubjectId(Integer subjectId);

    /**
     * 根据题目id获取数据
     *
     * @param id Integer
     * @return ZySubjectQuestionDO
     */
    ZySubjectQuestionDO getById(Integer id);

    /**
     * 根据套题id和作业次数获取数据
     *
     * @param subjectId     Integer
     * @param homeworkIndex Integer
     * @return ZySubjectQuestionDO
     */
    ZySubjectQuestionDO getBySubjectIdAndHomeworkIndex(@Param(KEY_SUBJECT_ID) Integer subjectId,
                                                       @Param(KEY_HOMEWORK_INDEX) Integer homeworkIndex);

    /**
     * 根据套题id和作业次数 判断数据是否存在
     *
     * @param subjectId     Integer
     * @param homeworkIndex Integer
     * @return Boolean
     */
    Boolean exist(@Param(KEY_SUBJECT_ID) Integer subjectId,
                  @Param(KEY_HOMEWORK_INDEX) Integer homeworkIndex);

    /**
     * 获取各种id信息
     *
     * @param eeoClassId eeo 课节id
     * @return IdInfoData
     */
    IdInfoData getIdInfoByEeoClassId(Integer eeoClassId);

    /**
     * 获取各种id信息
     *
     * @param lessonId Integer
     * @return IdInfoData
     */
    IdInfoData getIdInfoByLessonId(Integer lessonId);
}